<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('diymodel_list'); ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>自定义模型 </title>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
<link href="templates/css/pagination.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="templates/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/layindex.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/common.js"></script>
<script type="text/javascript" src="templates/js/forms.func.js"></script>
</head>

<body class="mainbody">
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
  <a href="home.php" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <span>自定义模型</span>
  <a href="javascript:location.reload();" class="reload">刷新</a>
</div>
<!--/导航栏-->

<!--工具栏-->
<div id="floatHead" class="toolbar-wrap">
  <div class="toolbar">
    <div class="box-wrap">
      <a class="menu-btn"></a>
      <div class="l-list">
        <ul class="icon-list">
          <li><?php if(IsModel('diymodel','add',1)) echo '<a class="add" href="diymodel_add.php"><i></i><span>添加新模型</span></a>';?></li>
        </ul>
      </div>
      
    </div>
  </div>
</div>
<!--/工具栏-->
<form method="post" action="" id="form1">
<!--列表-->
<div class="table-container">
  
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
    <tr>
      <th width="8%">ID</th>
      <th align="left" width="15%">模型名称</th>
      <th align="left" >模型标识</th>
      <th align="left">模型表名</th>
      <th align="left">状态</th>
      <th width="12%">操作</th>
    </tr>
  
	<?php

		$sql = "SELECT * FROM `#@__diymodel`";

		$dopage->GetPage($sql,'','','orderid,id');
		while($row = $dosql->GetArray())
		{
			switch($row['checkinfo'])
			{
				case 'true':
					$checkinfo = '启用';
					break;  
				case 'false':
					$checkinfo = '禁用';
					break;
				default:
					$checkinfo = '没有获取到参数';
			}
		?>
		<tr  >
			<td align="center"><?php echo $row['id']; ?></td>
			<td> <?php echo $row['modeltitle']; ?><a href="modeldata.php?m=<?php echo $row['modelname']; ?>" title="管理<?php echo $row['modelname']; ?>信息">  [进入信息管理]</a></td>
			<td><?php echo $row['modelname']; ?></td>
			<td><?php echo $row['modeltbname']; ?></td>
			<td><a href="diymodel_save.php?id=<?php echo $row['id']; ?>&action=check&checkinfo=<?php echo $row['checkinfo']; ?>" title="点击进行审核与未审操作"><?php echo $checkinfo; ?></a></td>
			<td > <span><a href="diyfield.php?cid=<?php echo $row['id']; ?>">字段</a></span> | <span><a href="diymodel_update.php?id=<?php echo $row['id']; ?>">修改</a></span> | <span class="nb"><a href="diymodel_save.php?action=del&id=<?php echo $row['id']; ?>&m=<?php echo $row['modeltitle']; ?>" onclick="return ConfDel(0)">删除</a></span></td>
		</tr>
		<?php
		
		}
		?>

  </table>
  
</div>
<!--/列表-->

<!--内容底部-->
<div class="line20"></div>
<div class="pagelist"  >
 
  <?php echo $dopage->GetList($sql); ?>

</div>
<!--/内容底部-->
</form>
</body>
</html>
